package com.example.feifei.newproject;

import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.widget.EditText;
import android.widget.ScrollView;

/**
 * Created by Administrator on 2018\9\12 0012.
 */

public class ScrollEditTextActivity extends Activity {
    private EditText edittext_scrollview;
    private ScrollView scroll_view;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_scroll_edit);
        scroll_view = (ScrollView) this.findViewById(R.id.scroll_view);
        edittext_scrollview = (EditText) this.findViewById(R.id.edittext_scrollview);
//        edittext_scrollview.setOnTouchListener(new View.OnTouchListener() {
//            @Override
//            public boolean onTouch(View v, MotionEvent event) {
//                // 解决scrollView中嵌套EditText导致不能上下滑动的问题
//                v.getParent().requestDisallowInterceptTouchEvent(true);
//                switch (event.getAction() & MotionEvent.ACTION_MASK) {
//                    case MotionEvent.ACTION_UP:
//                        v.getParent().requestDisallowInterceptTouchEvent(false);
//                        break;
//                } return false;
//            }
//        });
    }
}
